package org.redemptionhost.web.panels;

import java.io.Serializable;

import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.panel.Panel;
import org.redemptionhost.web.pages.AddHostPage;
import org.redemptionhost.web.pages.EditHostPage;
import org.redemptionhost.web.pages.HostEmailPage;
import org.redemptionhost.web.pages.ListHostPage;

public class AdminNavigationPanel extends Panel implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private final BookmarkablePageLink<ListHostPage> listHostPage;
	private final BookmarkablePageLink<EditHostPage> editHostPage;
	private final BookmarkablePageLink<AddHostPage> addHostPage;
	private final BookmarkablePageLink<HostEmailPage> hostEmailPage;

	public AdminNavigationPanel(String disabledClass) {
		super("navigationPanel");

		listHostPage = new BookmarkablePageLink<ListHostPage>("listHostsLink", ListHostPage.class);
		add(listHostPage);
		if (disabledClass.equalsIgnoreCase(ListHostPage.class.getName())) {
			listHostPage.setEnabled(false);
		}
		
		editHostPage = new BookmarkablePageLink<EditHostPage>("editHostLink", EditHostPage.class);
		add(editHostPage);
		if (disabledClass.equalsIgnoreCase(EditHostPage.class.getName())) {
			editHostPage.setEnabled(false);
		}
		
		addHostPage = new BookmarkablePageLink<AddHostPage>("addHostLink", AddHostPage.class);
		add(addHostPage);
		if (disabledClass.equalsIgnoreCase(AddHostPage.class.getName())) {
			addHostPage.setEnabled(false);
		}
		
		hostEmailPage = new BookmarkablePageLink<HostEmailPage>("hostEmailLink", HostEmailPage.class);
		add(hostEmailPage);
		if (disabledClass.equalsIgnoreCase(HostEmailPage.class.getName())) {
			hostEmailPage.setEnabled(false);
		}
	}
}
